package Thread;

import java.util.TimerTask;

public class MyTimerTask1 extends TimerTask {
    private final SharedResource resource;

    public MyTimerTask1 (SharedResource resource) {
        this.resource = resource;
    }

    @Override
    public void run() {
        resource.increment();
        System.out.println("Counter: " + resource.getCounter());
    }
}
